#include<stdio.h>
#include<string.h>

int main()
{
	int n,i,x,t=0,sum[100],a[100],b[10000];
	scanf("%d",&n);
	while (n--)
	{
		scanf("%d",&x);
		sum[t]=x;
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		for (i=0;i<x;i++)
		{
			scanf("%d",&a[i]);
			if (b[a[i]]==0)
				b[a[i]]=1;
			else
				sum[t]--;
		}
		t++;
	}
	for (i=0;i<t;i++)
		printf("%d\n",sum[i]);
	return 0;
}
